#include "esp8266.h"

UsartRecv_t g_esp_recev = {
	.handle = &huart2,
	.dma_handle = &hdma_usart2_rx, 
};


void esp8266_reset(void)
{
	bsp_gpio_clear(ESP_RST);
	HAL_Delay(500);
	bsp_gpio_set(ESP_RST);
	HAL_Delay(200);
}


uint8_t esp_send_str(uint8_t *str, int size)
{
    HAL_StatusTypeDef status;
    
    status = HAL_UART_Transmit(g_esp_recev.handle, str, size , 0xffff);

    return status == HAL_OK ? 0 : -1;
}







